package cn.sh.yhk.controller.basic;

import cn.sh.yhk.service.basic.ConfigService;
import cn.sh.yhk.vo.BasicVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Api(tags = "系统配置模块")
@Controller
@ResponseBody
@RequestMapping("/config")
public class ConfigController {

    @Resource
    ConfigService configService;

    @ApiOperation(value = "获取所有配置单", notes = "获取所有配置单")
    @PostMapping("/getall")
    public BasicVo getAllConfig() {

        return configService.getAllConfig();
    }

    @ApiOperation(value = "获取配置单根据主键", notes = "获取配置单根据主键")
    @PostMapping("/get")
    public BasicVo getConfigById(Long id) {
        return configService.getConfigById(id);
    }
}
